const express = require("express");
const router = express.Router();
const { alphaData, alphaProcessList, alphaOnlineList, alphaHoldingList } = require("../../data/mockData.js");

// 查询交易页面数据
router.get("/data/basic/alpha", (req, res) => {
    //   console.log(req.query, "req");
    res.success({ data: alphaData, message: 'alpha数据查询成功' });
});

// 查询交易表格数据  历史记录，处理中
router.get("/alpha/commission/process", (req, res) => {
    //   console.log(req.query, "req");
    res.success({ data: alphaProcessList });
});

// 全网成交
router.get("/alpha/commission/online", (req, res) => {
    //   console.log(req.query, "req");
    res.success({ data: alphaOnlineList });
});

// 我的持仓
router.get("/alpha/commission/holding", (req, res) => {
    //   console.log(req.query, "req");
    res.success({ data: alphaHoldingList });
});



// 交易
router.post("/buy/sell/alpha", (req, res) => {
    console.log(req.body, "交易请求数据");

    // 模拟交易逻辑
    res.success({ message: "alpha交易成功" });
});


module.exports = router;
